package hhm.android.main

import android.util.SparseArray
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import hhm.android.base.fragment.NewLazyFragment


class AdapterFragmentPager(fragmentActivity: FragmentActivity,var fragments: SparseArray<NewLazyFragment>) : FragmentStateAdapter(fragmentActivity) {

    override fun createFragment(position: Int): Fragment {
        return fragments[position]
    }

    override fun getItemCount(): Int {
        return fragments.size()
    }
}